﻿/*----------------------------------------------------------------
// Copyright (C) 2012
// 版权所有
//
// 文件名：OrderOnline_Login.cs
// 文件功能描述：
//
//
// 创建标识：Libing 2012-05-16 20:45:02 星期三
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Text;

namespace WMS.BLL
{
    public class OrderOnline_Login 
    {
		private static readonly WMS.IDAL.IOrderOnline_Login dal = WMS.DALFactory.OrderOnline_Login.Create();

		#region 基本方法

		/// <summary>
		/// 创建实体(可实现添加、修改操作)
		/// </summary>
		/// <param name="model">类型为WMS.Model.OrderOnline_Login的实体对象</param>
		/// <returns></returns>
		public bool Create(WMS.Model.OrderOnline_Login orderOnlineLogin)
		{
			switch (orderOnlineLogin.ModelState)
			{
				case WMS.Model.Enum.ModelState.Insert:
					return Insert(orderOnlineLogin);

				case WMS.Model.Enum.ModelState.Update:
					return Update(orderOnlineLogin);

				case WMS.Model.Enum.ModelState.UpdateMinimal:
					return UpdateMinimal(orderOnlineLogin);

				default:
					return false;
			}
		}

		/// <summary>
		/// 添加实体
		/// </summary>
		/// <param name="model">类型为WMS.Model.OrderOnline_Login的实体对象</param>
		/// <returns></returns>
		public bool Insert(WMS.Model.OrderOnline_Login orderOnlineLogin)
		{
			try
			{
				return dal.Insert(orderOnlineLogin);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		/// <summary>
		/// 修改实体
		/// </summary>
		/// <param name="model">类型为WMS.Model.OrderOnline_Login的实体对象</param>
		/// <returns></returns>
		public bool Update(WMS.Model.OrderOnline_Login orderOnlineLogin)
		{
			try
			{
				return dal.Update(orderOnlineLogin);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		/// <summary>
		/// 修改实体
		/// </summary>
		/// <param name="model">类型为WMS.Model.OrderOnline_Login的实体对象</param>
		/// <returns></returns>
		public bool UpdateMinimal(WMS.Model.OrderOnline_Login orderOnlineLogin)
		{
			try
			{
				return dal.UpdateMinimal(orderOnlineLogin);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		/// <summary>
		/// 删除实体(根据主键 ID)
		/// </summary>
		/// <param name="id">Id</param>
		/// <returns></returns>
		public bool DeleteByID(string id)
		{
			try
			{
				return dal.DeleteByID(id);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		/// <summary>
		/// 删除实体(指定条件)
		/// </summary>
		/// <param name="whereClause">WHERE语句</param>
		/// <returns></returns>
		public bool DeleteDynamic(string whereClause)
		{
			try
			{
				return dal.DeleteDynamic(whereClause);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		/// <summary>
		/// 获取实体(根据主键 ID)
		/// </summary>
		/// <param name="id">Id</param>
		/// <returns></returns>
		public WMS.Model.OrderOnline_Login GetByID(string id)
		{
			try
			{
				return dal.GetByID(id);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		#endregion

		#region	公共方法

		/// <summary>
		/// 获取实体列表(指定数目和查询条件)
		/// </summary>
		/// <param name="topClause">指定实体数</param>
		/// <param name="whereClause">WHERE语句</param>
		/// <returns></returns>
		public List<WMS.Model.OrderOnline_Login> Get(int topClause, string whereClause)
		{
			try
			{
				return dal.Get(topClause, whereClause);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		/// <summary>
		/// 获取实体列表(指定查询条件)
		/// </summary>
		/// <param name="whereClause">WHERE语句</param>
		/// <returns></returns>
		public List<WMS.Model.OrderOnline_Login> Get(string whereClause)
		{
			try
			{
				return dal.Get(whereClause);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		/// <summary>
		/// 获取分页实体列表
		/// </summary>
		/// <param name="whereClause">WHERE 语句</param>
		/// <param name="orderByClause">ORDER BY 语句</param>
		/// <param name="pageIndex">分页索引</param>
		/// <param name="pageSize">分页大小(每页显示的记录数)</param>
		/// <param name="totalRecords">记录总数</param>
		/// <returns></returns>
		public List<WMS.Model.OrderOnline_Login> GetPaged(string whereClause, string orderBy, int pageIndex, int pageSize, out int totalRecords)
		{
			try
			{
				return dal.GetPaged(whereClause, orderBy, pageIndex, pageSize, out totalRecords);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		#endregion

		#region 自定义方法
		#endregion
	}
}